<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Karthika Movva</title>
    <description>The latest articles on Forem by Karthika Movva (@karthika_movva).</description>
    <link>https://forem.com/karthika_movva</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1889280%2F97d7bfd8-bc03-49a2-aeee-8713fe56c675.png</url>
      <title>Forem: Karthika Movva</title>
      <link>https://forem.com/karthika_movva</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/karthika_movva"/>
    <language>en</language>
    <item>
      <title>In my Problem Solving Journey</title>
      <dc:creator>Karthika Movva</dc:creator>
      <pubDate>Thu, 26 Dec 2024 10:31:16 +0000</pubDate>
      <link>https://forem.com/karthika_movva/in-my-problem-solving-journey-1f4e</link>
      <guid>https://forem.com/karthika_movva/in-my-problem-solving-journey-1f4e</guid>
      <description>&lt;p&gt;Hey, glad to report that I could push my competitive programming career forward. I begin from scratch on linked lists and have started learning some more complex concepts. After all, I had mastered the basics so I jumped to more complex topics. I've learned about linked lists and could solve a few questions based on this for the last two days. Today, I have practiced questions on Dojo as I have to answer them this week in my dojo. So, I was prepared for that. Therefore, today, I have practiced three different questions that were based on linked lists. One was a tough question and was based on the concept of a matrix, and the other two were at a moderate level of difficulty.&lt;/p&gt;

&lt;p&gt;For the first question, I was working on a matrix problem where we had to rotate the given matrix. For the first index (0), we had to rotate it clockwise once and then print it out using a linked list. The next question was about the life cycle, where we used the rabbit and tortoise algorithm. In this question, if both the rabbit and the tortoise move in a straight line, then they won't meet; but if they move in a circle, then they will eventually meet at one point. And that point is telling us that a cycle exists. We have a cycle if we return true; otherwise, we return false.&lt;/p&gt;

&lt;p&gt;Last but not least, I solved a remove duplicates question where we were given a sorted array and had to remove all the duplicate numbers and print the new array. For example, if the array is [0, 1, 1, 2, 2], we remove all the repeated numbers, and the output should be [0, 1, 2]. The day was great and productive overall.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>productivity</category>
      <category>learning</category>
    </item>
    <item>
      <title>My Problem Solving Experience</title>
      <dc:creator>Karthika Movva</dc:creator>
      <pubDate>Mon, 23 Dec 2024 08:11:49 +0000</pubDate>
      <link>https://forem.com/karthika_movva/my-problem-solving-experience-3656</link>
      <guid>https://forem.com/karthika_movva/my-problem-solving-experience-3656</guid>
      <description>&lt;p&gt;Hi, folks! Today, I solved three problems on LeetCode: “Find All Anagrams in a String,” “Longest Consecutive Sequence,” and “Search in Rotated Sorted Array.” These problems are really interesting, and we have different logical approaches to solve them. They are extensions of the classic problems of checking if two strings are anagrams and searching for a target element in an array.&lt;/p&gt;

&lt;p&gt;Find All Anagrams in a String This problem can be solved by the sliding window technique. We should scan the input array while keeping track of a fixed length of consecutive elements. We check whether this segment is an anagram of the target string. If it is, we add the index to the result array; if not, we ignore the index. In this way we can solve the problem.&lt;/p&gt;

&lt;p&gt;Longest Consecutive Sequence: To solve this problem we first eliminate duplicate elements using a set. We traverse the array and check if there exists any sequence of elements that are consecutive in nature (+1 or -1). If it so exists then we keep a track of its length, otherwise, we simply ignore this. This way we can find out the length of the longest consecutive sequence.&lt;/p&gt;

&lt;p&gt;Search in Rotated Sorted Array: We can solve this problem using the binary search approach. We divide the input array into two halves. We then determine that which half is sorted, and then do a binary search for that half to find our target element. If the target was not in the sorted half, we continue the search for the target element in the unsorted half. If the target element is not found in either of the halves, then we return -1. In this way, we can solve this problem.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>productivity</category>
      <category>learning</category>
    </item>
    <item>
      <title>Ways to Solve a Problem</title>
      <dc:creator>Karthika Movva</dc:creator>
      <pubDate>Mon, 23 Dec 2024 08:04:40 +0000</pubDate>
      <link>https://forem.com/karthika_movva/ways-to-solve-a-problem-2l96</link>
      <guid>https://forem.com/karthika_movva/ways-to-solve-a-problem-2l96</guid>
      <description>&lt;p&gt;Hello, People! Today I managed to solve three problems in LeetCode: Single Number, First Missing Positive, and Next Greater Element III. There is a general mistake that each of us, including myself, makes. For example, when we find such an easy problem, perhaps we tend to skip it, or use some familiar algorithm to solve it as a matter of course, instead of looking further. However, use resources in finding whether or not the solution you find is the most efficient; if not, take your time to learn the better solution.&lt;/p&gt;

&lt;p&gt;Single Number is an easy problem, and I knew of one solution. However, I was curious to know whether there existed an even better solution. So, when I found it, I was really surprised that the problem could be solved in such an efficient way.&lt;/p&gt;

&lt;p&gt;Similarly, when solving First Missing Positive and Next Greater Element III, it is very important to focus on building a solid logic first. Then break it down into smaller steps this will simplify the process. Approaching problems in this way helps to develop better solutions.&lt;/p&gt;

&lt;p&gt;I hope my experience will be helpful to you.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>productivity</category>
      <category>learning</category>
    </item>
    <item>
      <title>In my Problem Solving Journey</title>
      <dc:creator>Karthika Movva</dc:creator>
      <pubDate>Mon, 16 Dec 2024 18:45:52 +0000</pubDate>
      <link>https://forem.com/karthika_movva/in-my-problem-solving-journey-229p</link>
      <guid>https://forem.com/karthika_movva/in-my-problem-solving-journey-229p</guid>
      <description>&lt;p&gt;Hi, folks! Today, I solved four problems on LeetCode: Generate Parentheses, 3Sum Closest, Remove K-Digits, and Number of Subarrays with Bounded Maximum. Each problem can be solved using different concepts. By solving at least one problem from each concept, we can recap various concepts in a single day.&lt;/p&gt;

&lt;p&gt;The Generate Parentheses problem can be solved using recursion. 3Sum Closest can be solved with the two-pointer technique. Remove K-Digits is a logical problem that can be approached using a stack. Finally, Number of Subarrays with Bounded Maximum can also be solved with a logical approach.&lt;/p&gt;

&lt;p&gt;In the Generate Parentheses problem, we need to find all possible arrangements of parentheses for a given number. With the help of recursion, we repeat the process until we find all possible arrangements. The base condition is reaching the input number.&lt;/p&gt;

&lt;p&gt;In the 3Sum Closest problem, we use the two-pointer technique. We start with the left pointer at zero and the right pointer at the last index. We traverse with both pointers until we find the sum closest to the target.&lt;/p&gt;

&lt;p&gt;To solve Remove K-Digits, we need to use a stack along with a logical approach. In this problem, we also have to handle edge cases like leading zeros. The stack is used to store smaller digits in each iteration, and at the end, we pop the stack to create the new number.&lt;/p&gt;

&lt;p&gt;For the Number of Subarrays with Bounded Maximum, we can use a loop to traverse the array, compare each element with the given bounds, and increment the count accordingly. In the end, we return the count.&lt;/p&gt;

&lt;p&gt;I hope my experience will be helpful!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>productivity</category>
      <category>learning</category>
    </item>
    <item>
      <title>My Problem Solving Experience</title>
      <dc:creator>Karthika Movva</dc:creator>
      <pubDate>Mon, 16 Dec 2024 18:44:17 +0000</pubDate>
      <link>https://forem.com/karthika_movva/my-problem-solving-experience-53j9</link>
      <guid>https://forem.com/karthika_movva/my-problem-solving-experience-53j9</guid>
      <description>&lt;p&gt;Hi, Folks! Today, I solved three problems on LeetCode: Sum of Subarray Ranges, Largest Rectangle in Histogram, and Evaluate Reverse Polish Notation. All these problems can be solved using a stack, and each problem has a unique logic along with the implementation of stacks.&lt;/p&gt;

&lt;p&gt;Sum of Subarray Ranges can be solved both with and without using a stack. Using a brute-force approach, we can solve the problem without a stack. However, using stacks can optimize the solution.&lt;/p&gt;

&lt;p&gt;To solve Largest Rectangle in Histogram, we use a stack to store the indices of the bars representing the minimum heights. Using these heights, we calculate the areas and determine the maximum area among them. This approach allows us to solve the problem efficiently.&lt;/p&gt;

&lt;p&gt;To solve Evaluate Reverse Polish Notation, we use a stack. We push the digits onto the stack and pop them when we encounter operators, applying the operations accordingly. In this way, we can evaluate the expression.&lt;/p&gt;

&lt;p&gt;To solve Sum of Subarray Ranges using stacks, we use two stacks: one to calculate the sum of minimums and the other to calculate the sum of maximums. At the end, we subtract the sum of minimums from the sum of maximums to get the sum of subarray ranges.&lt;/p&gt;

&lt;p&gt;I hope my experience will be helpful!&lt;/p&gt;

&lt;p&gt;Python3&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>productivity</category>
      <category>learning</category>
    </item>
    <item>
      <title>Problem Solving Experience</title>
      <dc:creator>Karthika Movva</dc:creator>
      <pubDate>Mon, 16 Dec 2024 18:41:52 +0000</pubDate>
      <link>https://forem.com/karthika_movva/problem-solving-experience-88j</link>
      <guid>https://forem.com/karthika_movva/problem-solving-experience-88j</guid>
      <description>&lt;p&gt;Hi, Folks! Today, I solved three problems on LeetCode: Permutation Sequence, Maximum Number of K-Sum Pairs, and Longest Palindromic Substring. We can solve both Maximum Number of K-Sum Pairs and Longest Palindromic Substring using the two-pointer technique, while Permutation Sequence can be solved with a logical approach.&lt;/p&gt;

&lt;p&gt;We can relate the two-pointer technique to our daily lives. For example, let’s say we are searching for a book on a shelf. If only one person is searching, it will take longer compared to two people searching together. Similarly, the two-pointer technique involves traversing an array from both sides: the first pointer starts at index zero, moving from left to right, while the second pointer starts at the last index, moving from right to left. This simultaneous traversal helps us reach the target faster.&lt;/p&gt;

&lt;p&gt;To solve Permutation Sequence, we use a logical approach. Understanding the logic behind this problem often requires multiple dry runs of the code. Explaining the solution in words can be challenging, so it might be helpful to consult additional resources if you’re struggling to solve it on your own. Grasping the concept and logic behind the code is essential for solving this problem.&lt;/p&gt;

&lt;p&gt;I hope my experience will be helpful!&lt;/p&gt;

&lt;p&gt;Python3&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>productivity</category>
      <category>learning</category>
    </item>
    <item>
      <title>In Problem Solving Journey</title>
      <dc:creator>Karthika Movva</dc:creator>
      <pubDate>Sun, 15 Dec 2024 09:37:57 +0000</pubDate>
      <link>https://forem.com/karthika_movva/in-problem-solving-journey-28bp</link>
      <guid>https://forem.com/karthika_movva/in-problem-solving-journey-28bp</guid>
      <description>&lt;p&gt;Hi, folks! Today, I solved three problems on LeetCode: “Find All Anagrams in a String,” “Longest Consecutive Sequence,” and “Search in Rotated Sorted Array.” These problems are really interesting, and we have different logical approaches to solve them. They are extensions of the classic problems of checking if two strings are anagrams and searching for a target element in an array.&lt;/p&gt;

&lt;p&gt;Find All Anagrams in a String: To solve this problem, we can use the sliding window technique. We need to traverse the input array while keeping track of a fixed length of consecutive elements. We check whether this segment is an anagram of the target string. If it is, we add the index to the result array; if not, we ignore the index. In this way we can solve the problem.&lt;/p&gt;

&lt;p&gt;Longest Consecutive Sequence: To solve this problem, we first remove duplicate elements from the array using a set. Then, we traverse the array and check for any sequence of consecutive elements (+1 or -1). If such a sequence exists, we keep track of its count; otherwise, we ignore it. This way, we can determine the length of the longest consecutive sequence.&lt;/p&gt;

&lt;p&gt;Search in Rotated Sorted Array: To solve this problem, we can use the binary search approach. First, we divide the input array into two parts. We then identify which half is sorted and perform a binary search on that half to find the target element. If the target is not found in the sorted half, we continue searching in the unsorted half. If the target element is not found in either half, we return -1. In this way we can solve this problem.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>productivity</category>
      <category>learning</category>
    </item>
    <item>
      <title>Learn Algorithms</title>
      <dc:creator>Karthika Movva</dc:creator>
      <pubDate>Sun, 15 Dec 2024 09:35:57 +0000</pubDate>
      <link>https://forem.com/karthika_movva/learn-algorithms-c1j</link>
      <guid>https://forem.com/karthika_movva/learn-algorithms-c1j</guid>
      <description>&lt;p&gt;Hi, Folks! Today, I solved three problems on LeetCode: Max Chunks to Make Sorted, Find the Town Judge, and Maximum Subarray. Every competitive programmer has their own logic to solve problems. However, algorithms can sometimes optimize the solution. For a programmer, solving the problem is not the challenge; solving the problem in an optimized way is the real challenge. This can sometimes be achieved through algorithms and sometimes with our own logic. As programmers, we should know both algorithmic and logical approaches.&lt;/p&gt;

&lt;p&gt;Max Chunks to Make Sorted: To solve this problem, we can traverse through the input array and, for each traversal, find the maximum number in the array. Every time you find a new maximum number, keep track of the count. This count will be the result. This approach will solve the problem effectively.&lt;/p&gt;

&lt;p&gt;Find the Town Judge: To solve this problem, we first need to fully understand the problem statement. We need to identify the town judge, who trusts no one but is trusted by everyone else. Once we grasp the problem statement, solving it becomes straightforward.&lt;/p&gt;

&lt;p&gt;Maximum Subarray: To solve this problem, we can use Kadane’s Algorithm, which is one of the most efficient ways to solve it. Using this algorithm makes the problem much easier compared to my initial logic.&lt;/p&gt;

&lt;p&gt;I hope my experience will be helpful.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>productivity</category>
      <category>learning</category>
    </item>
    <item>
      <title>Explore the ways to solve a problem</title>
      <dc:creator>Karthika Movva</dc:creator>
      <pubDate>Sun, 15 Dec 2024 09:34:21 +0000</pubDate>
      <link>https://forem.com/karthika_movva/explore-the-ways-to-solve-a-problem-bnn</link>
      <guid>https://forem.com/karthika_movva/explore-the-ways-to-solve-a-problem-bnn</guid>
      <description>&lt;p&gt;Hi, Folks! Today, I solved three problems on LeetCode: Single Number, First Missing Positive, and Next Greater Element III. There are some common mistakes that most of us make myself included. For instance, when we come across an easy problem, we might be tempted to ignore it or use a familiar approach to quickly solve it, then move on without exploring further. However, it’s important to use resources to determine whether the solution you found is the most efficient one. If it’s not, take the time to learn the more efficient solution.&lt;/p&gt;

&lt;p&gt;Single Number is an easy problem, and I was familiar with one approach. However, I was curious to find the most efficient solution. When I discovered it, I was really surprised that the problem could be solved in such an efficient way.&lt;/p&gt;

&lt;p&gt;Similarly, when solving First Missing Positive and Next Greater Element III, it’s crucial to focus on building a solid logic first. Then, break it down into smaller steps this will simplify the process. Approaching problems in this way helps to develop better solutions.&lt;/p&gt;

&lt;p&gt;I hope my experience will be helpful to you.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>productivity</category>
      <category>learning</category>
    </item>
    <item>
      <title>Experience in Problem Solving</title>
      <dc:creator>Karthika Movva</dc:creator>
      <pubDate>Sun, 15 Dec 2024 09:32:34 +0000</pubDate>
      <link>https://forem.com/karthika_movva/experience-in-problem-solving-if6</link>
      <guid>https://forem.com/karthika_movva/experience-in-problem-solving-if6</guid>
      <description>&lt;p&gt;Hi, Folks! Today, I solved three problems on LeetCode: Letter Combination of a Phone Number, Container with Most Water, and Rotate Array. Solving different problems every day helps us to think about problems from different angles. There are various ways to solve a problem. If you find one way to solve it, don’t stop there try to optimize the solution further. This will help you find the most efficient way to solve the given problem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Letter Combination of a Phone Number:&lt;/strong&gt; To solve this problem, we can use the concept of backtracking with one base condition. We need to find all possible combinations of characters linked to specific digits in the given input. The base condition will help us stop the function’s execution when necessary. This approach allows us to solve the problem effectively.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Container with Most Water:&lt;/strong&gt; In this problem, we need to find the maximum area that can be formed. We can traverse the array using two pointers: one starting from the beginning of the array and the other from the end. This method helps us efficiently find the solution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rotate Array:&lt;/strong&gt; The task here is to rotate the array by a specified number of positions. We can achieve this by slicing the array according to the specified position and creating a new array by appending the slices in the correct order. This approach solves the problem effectively.&lt;/p&gt;

&lt;p&gt;I hope my experience will be helpful to you.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>productivity</category>
      <category>learning</category>
    </item>
    <item>
      <title>Problem Solving Challenges</title>
      <dc:creator>Karthika Movva</dc:creator>
      <pubDate>Sun, 15 Dec 2024 09:30:03 +0000</pubDate>
      <link>https://forem.com/karthika_movva/problem-solving-challenges-b8p</link>
      <guid>https://forem.com/karthika_movva/problem-solving-challenges-b8p</guid>
      <description>&lt;p&gt;Hi, Folks! Today, I solved three problems on LeetCode: Koko Eating Bananas, Maximize the Confusion of an Exam, and Target Sum. Today is the start of the week, so I planned to solve some problems this week. This can help me understand data structures better. There are some problems that I repeated in this week’s plan because I feel that these problems are conceptual and tough to understand. These problems may take practice several times to get a better understanding. So, repeating problems like N-Queens will be helpful.&lt;/p&gt;

&lt;p&gt;In LeetCode, there are so many problems, and it is not important how many problems we solve. The concepts we learn and the logic we apply really matter a lot. Koko Eating Bananas and Maximize the Confusion of an Exam are revision problems for today. They helped me go through the logic once again, and I also learned some concepts in data structures, such as deque, stacks, and queues. Revising all the concepts will help us memorize the important ones for a long time.&lt;/p&gt;

&lt;p&gt;To solve the target sum problem, we will use dynamic programming (DP). The DP approach will help us keep track of how many solutions we have found. Since we need to return the total number of possible solutions from the array to get the target element, this method will help us to solve the problem.&lt;/p&gt;

&lt;p&gt;I hope my experience will be helpful.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>productivity</category>
      <category>learning</category>
    </item>
    <item>
      <title>Time to Solve</title>
      <dc:creator>Karthika Movva</dc:creator>
      <pubDate>Sun, 15 Dec 2024 09:21:52 +0000</pubDate>
      <link>https://forem.com/karthika_movva/time-to-solve-n77</link>
      <guid>https://forem.com/karthika_movva/time-to-solve-n77</guid>
      <description>&lt;p&gt;Hi, Folks! Today, I solved three problems on LeetCode : Bag of tokens, k-th smallest prime fraction, and Fruits into basket. As a Beginner, you need patience, and it’s okay to take a long time to solve problems. Depending on their difficulty, some problems may take days to solve. In the future, if you aim to solve a problem with in minutes, you need to spend more time in practicing. We should not get discouraged if it takes us a long time to solve a hard level or medium level problems.&lt;/p&gt;

&lt;p&gt;If we invest really hours or even days solving a problem, the joy we feel once it’ solved is unimaginable. Try to stay curious and approach the problems as challenges rather than burdens. this will help you to enjoy the problem solving more.&lt;/p&gt;

&lt;p&gt;For example, solving the kth smallest prime fraction problem took me almost 4–5 hours. Coming up with a logic itself took a lot of time. If a problem feels hard, don’t give up. Find resources to learn the concept related to problem, and then give it another try.&lt;/p&gt;

&lt;p&gt;Bag of tokens : To solve this problems, we can use two pointers left and right. The left pointer will start from the 0th index, and the The right pointer will start from the last index. We can traverse the array of tokens with pointers, increment and decrement the value of power depending on values of the tokens. Create a variable ‘score’, to store the updated score at each step and we can return score as output. This is one way to solve this problem.&lt;/p&gt;

&lt;p&gt;I hope my experience will be helpful.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>productivity</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
