coderz.py

Keep Coding Keep Cheering!

Longest Substring with K Distinct Characters

Given an integer k and a string s, write a function to determine the length of the longest substring in s that contains at most k distinct characters.

January 16, 2025 | Amazon, dsa, DSA Sheet | No comments

Staircase Climbing Ways

There is a staircase with N steps, and you can ascend either 1 step or 2 steps at a time. Write a function to calculate the number of unique ways to climb the staircase. The sequence of steps matters.

January 11, 2025 | Amazon, Data Structure, dsa | No comments

Advertisement