© 2026 Hashnode
Let’s dive into explaining the solution for LeetCode Problem 1356: Sort Integers by The Number of 1 Bits, covering the problem requirements, the provided code’s functionality, a complexity analysis, and verifying the solution’s correctness. The code ...

LeetCode Link Topics: String,Backtracking,Greedy,Counting,Enumeration,DFS Date: 27th June 2025 Problem Statement Given a string s and an integer k, return the longest subsequence of s such that the subsequence can be repeated k times as a subsequenc...

Problem Description I assume you have read the original problem description in the link above, so I will share some key points about a common mistake in the problem, which is using a greedy approach. A common mistake: greedily delete from the most co...

Problem Description Thinking process Let's read the problem description first. It mentioned that we have a list of directions in sequence, given at most k times to change direction at any step. How far can you go from the base point in Manhattan dist...
