Finding the Longest Palindromic Substring (LeetCode Problem)

Introduction: In this blog post, we’ll explore a problem from LeetCode – finding the longest palindromic substring in a given string. A palindrome is a string that reads the same backwards as forward, such as “racecar” or “kayak“. We’ll start with a brute-force approach, discuss its time complexity, and then move on to an optimal […]

Conquering the GS Interview 💼: Transforming Fractions to Decimals and Cyclic Patterns 📝

🤔 The Challenge: Fractions to Decimals In the world of mathematics, fractions are a fundamental concept that represents the division of one integer by another non-zero integer. While some fractions can be easily converted to their decimal counterparts (e.g., 1/2 = 0.5), others exhibit a peculiar behaviour known as cyclic decimals. These fractions, when converted […]

Finding All Combination Sum Up to a Target in Java

In this tutorial, we’ll explore a common problem in algorithm design: given an array of integers and a target sum, how can we find all possible combinations of numbers in the array that add up to the target? Furthermore, we’ll allow the repetition of numbers in our combinations, adding a twist to the classic combination […]