Tcs Coding Questions 2021 【LATEST ✭】
Many lost marks by using replace() in Python without controlling overlap. Question 3: The "Autobiographical Number" (Digit Frequency) Problem Statement: An autobiographical number is an integer N such that the first digit (from left) counts how many zeros are in N, the second digit counts how many ones, and so on. Given a number (as a string), verify if it's autobiographical.
import java.util.Scanner; public class Main public static void main(String[] args) Scanner sc = new Scanner(System.in); String num = sc.next(); int len = num.length(); int[] freq = new int[10]; Tcs Coding Questions 2021
Q2 Solution: String reversal