Data Structures & AlgorithmsHardGATE CS · TCS NQT
How many integers from 1 to 200 inclusive are palindromes when written in decimal?
- A. 29
- B. 28
- C. 27
- D. 19
Correct answer: B. 28
Decimal palindromes: 9 one-digit, 9 two-digit and 10 three-digit values (101 to 191), giving 28.
Practise more Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questionsArrays, Strings, Linked Lists, Stacks, Queues and Hashing: notes and key points
More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions
- How many index pairs i < j in [3, 5, 6, 9, 10] have a[i] XOR a[j] with an odd number of 1-bits?
- What is the minimum number of swaps of any two positions needed to make [2, 1, 2, 1, 3, 3, 1] sorted in non-decreasing order?
- Concatenate "abba" and "baab" into one string, then count its distinct substrings of length 2.
- In the text "abcabdabc", how many positions match the pattern "a?c" where '?' matches any single character?
- Sum, over the queries x = 3, 6, 9 on the sorted array [1, 3, 3, 5, 8, 9, 12], of the number of elements that are less than or equal to x…
- How many index pairs i < j in [1, 3, 5, 7, 9, 15] have a sum that is a power of two?