Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Write a function to check if a string is an anagram of another string.

Medium

Problem Statement

Write a function to check if a string is an anagram of another string.

Sample Input

Two strings: str1 = "listen", str2 = "silent"

Sample Output

True (since they are anagrams)

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
fun longestIncreasingSubsequence(arr: Array<Int>): List<Int> { // Add your code here to find the longest increasing subsequence } fun main() { val array = arrayOf(10, 22, 9, 33, 21, 50, 41, 60) println("Longest increasing subsequence: ${longestIncreasingSubsequence(array)}") }
Log in or sign up to run or submit your code.Log inSign up
Input
Two strings: str1 = "listen", str2 = "silent"
Expected Output
True (since they are anagrams)