Digital Sequence
Practice
3.8 (44 votes)
1 D array
Arrays
Data structures
Easy
Easy
Problem
81% Success 7400 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code
Description
You are given an array A of length N. You need to find maximum length of subsequence of A which contains any one digit common in all the elements of that subsequence. You are not allowed to count leading zeroes.
Input Format:
First line of input contains N, denoting number of elements.
Second line of input contains N space separated integers, denoting array elements.
Output Format:
Single integer representing maximum length of subsequence containing one digit common.
Input Constraints:
\(1 \le N \le 10^5\)
\(1 \le A_i \le 10^9\)
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
280 votes
Tags:
ApprovedData StructuresEasyOpenQueue
2.2 arrays
Points:20
75 votes
Tags:
1-D ArrayArraysData StructuresEasy
Points:20
65 votes
Tags:
ArraysC++1-DData StructuresGreedy AlgorithmsBasics of Greedy AlgorithmsMath
Editorial
Login to unlock the editorial