life is too short for a diary

Posts Tagged: two pointers

Leetcode - Longest Substring Without Repeating Characters

In this [leetcode]( problem, we are asked to find the length of the longest string of characters in a provided string that does not contain repeating characters. In other words, in the string `abcabcbb` the longest substring without repeating characters is `abc` (with a length of 3)...

Continue reading → leetcode two pointers set string

Ternary String solution Codeforces - 1354B

Ternary string is an interesting problem that could be solved using two pointers techniques. It's a convenient way to keep track of multiple indices. This helps in making decisions based on two values...

Continue reading → codeforces two pointers java python

Three Sum Problem Leetcode Solution

Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero...

Continue reading → leetcode two pointers java