Google Intern OA Problems

Revision en2, by Don_quixxote, 2025-07-07 14:37:41

Problem 1.

Given an array find no. of non-empty subsequences which does not have three consecutive odd or three consecutive even numbers in subsequence. Since answer is large print it modulo 1e9+7. 
Expected time complexity is O(N) or (ONlogN).
hint
code
Problem 2.
A number X is said to be palindrome special, if every digit i present in X occurs exactly i times and digits of X form a palindrome, you are given t test cases (<=1e5) and in each test case integer N(<=1e17). Find nearest greater no. which is a special palindrome.

Possible solution :- Precompute + BinarySearch

Tags google, internship, 2025

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English Don_quixxote 2025-07-07 17:28:11 289
en2 English Don_quixxote 2025-07-07 14:37:41 1983
en1 English Don_quixxote 2025-07-07 09:34:07 4230 Initial revision (published)