Question Date
Merge Two Sorted Lists 03-04-2025
Find the First Non-Repeating Character
Count Occurrences of Each Character in a String
Check for Anagrams
Find the Factorial of a Number
Reverse a String
Check for Palindrome
Find the Second Largest Number in a List:
Find Missing Number in an Array (1 to n):
Remove Duplicates from a List:
Fibonacci
Count Sequence:
Vowels in a String
Write a function to calculate the sum of the digits of a given integer.
Input:
# Write123a function to determine if a given string consists only of
# Write a digits
numeric program(e.g.,
to "123" → True,
capitalize "12a3"
the first →ofFalse).
letter each 08-04-2025
word
# Writein a
a function
sentenceto(e.g., "hellothe
calculate world" → "Hello
Greatest World").
Common Divisor
# Write a function that takes a nested list and returns a 18 is 6).
(GCD) of two integers using a loop (e.g., GCD of 48 and
single
returnsflattened
all pairs list (e.g., [1, that
of numbers [2, 3],
add[4,up
[5]]]
to → [1, 2, 3, 4, 5])
the target
Write (e.g., that
a function [2, 4,returns
3, 5] and
the target 7 → [(2, in
first character 5), (4, 3)])
a string
from that does
shortest not repeat (e.g., "swiss" → "w").
to longest
(e.g., ["cat", "elephant", "dog"] → ["cat", "dog", "elephant"]).
isdigit(),
isalpha(), we can use
2. title() using builtin method
returnk.append(i)
max(l)
return k
dic[value] = index
returnreturn
pair i
s[j], s[j+1] = s[j+1],s[j]
return s