6 kyu

Consecutive Count

803 of 1,497Capocaccia

Description:

I want to know the size of the longest consecutive elements of X in Y. You will receive two arguments: items and key. Return the length of the longest segment of consecutive keys in the given items.

Notes:

  • The items and the key will be either an integer or a string (consisting of letters only)
  • If the key does not appear in the items, return 0

Examples

90000, 0           -->  4
"abcdaaadse", "a"  -->  3
"abcdaaadse", "z"  -->  0
Fundamentals

More By Author:

Check out these other kata created by Capocaccia

Stats:

CreatedSep 21, 2017
PublishedSep 21, 2017
Warriors Trained2469
Total Skips23
Total Code Submissions6745
Total Times Completed1497
JavaScript Completions803
Python Completions692
Ruby Completions47
Total Stars29
% of votes with a positive feedback rating94% of 301
Total "Very Satisfied" Votes266
Total "Somewhat Satisfied" Votes31
Total "Not Satisfied" Votes4
Total Rank Assessments14
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • Capocaccia Avatar
  • suic Avatar
  • anter69 Avatar
  • Voile Avatar
  • albertogcmr Avatar
  • Just4FunCoder Avatar
Ad