Karan Shishodia’s Post

View profile for Karan Shishodia, graphic

Software Engineer @AMDOCS | 🚀 1742 @Leetcode | Pupil @Codeforces | 4⭐ 1817 @CodeChef | DSA | Competitive Programmer | ⚡️ 👨💻 MERN Stack Developer | NIET'24

Solved 3 out of 4 problems in today's LeetCode Weekly Contest 402! Question 1: I solved it simply using brute force: if (nums[i] + nums[j]) % 24 == 0, increase the count. Submission Link: https://lnkd.in/giV9CfV8 Question 2: Here, I utilized a hashMap to reduce the time complexity because my previous solution was O(N*N). However, in hurry, I received a penalty because I didn't notice the return type of the function (long). I mistakenly assumed it was the same return type as the previous problem (int). Submission Link: https://lnkd.in/gRYBpQj9 Question 3: I quickly realized this required a standard take or not take DP approach (as we can only take power[i] and not the remaining +-2), but implementing it took a long time. Submission Link: https://lnkd.in/g3BZCx7W Happy Coding! 💕 #Algorithm #CodingChallenge #CompetitiveProgramming #TechSolution #DataStructures #LeetCode #Programming #SoftwareDevelopment #ProblemSolving #TechEditorial #DynamicProgramming #CodingTips #SoftwareEngineering #TechCommunity #DevLife #TechSkills

  • graphical user interface, text, application

To view or add a comment, sign in

Explore topics