7 kyu
Maximum Length Difference
866 of 29,598g964
Description:
You are given two arrays a1
and a2
of strings. Each string is composed with letters from a
to z
.
Let x
be any string in the first array and y
be any string in the second array.
Find max(abs(length(x) − length(y)))
If a1
and/or a2
are empty return -1
in each language
except in Haskell (F#) where you will return Nothing
(None).
Example:
a1 = ["hoqq", "bbllkw", "oox", "ejjuyyy", "plmiis", "xxxzgpsssa", "xxwwkktt", "znnnnfqknaz", "qqquuhii", "dvvvwz"]
a2 = ["cccooommaaqqoxii", "gggqaffhhh", "tttoowwwmmww"]
mxdiflg(a1, a2) --> 13
Bash note:
- input : 2 strings with substrings separated by
,
- output: number as a string
Fundamentals
Similar Kata:
Stats:
Created | Dec 6, 2015 |
Published | Dec 6, 2015 |
Warriors Trained | 74675 |
Total Skips | 15813 |
Total Code Submissions | 188181 |
Total Times Completed | 29598 |
Ruby Completions | 866 |
Python Completions | 7586 |
JavaScript Completions | 7417 |
CoffeeScript Completions | 25 |
C# Completions | 1477 |
Haskell Completions | 436 |
Java Completions | 3408 |
Clojure Completions | 281 |
C++ Completions | 2002 |
PHP Completions | 1235 |
Crystal Completions | 33 |
C Completions | 924 |
TypeScript Completions | 774 |
F# Completions | 121 |
Shell Completions | 183 |
OCaml Completions | 56 |
Kotlin Completions | 967 |
Elixir Completions | 199 |
Julia Completions | 56 |
R Completions | 171 |
Scala Completions | 300 |
PowerShell Completions | 108 |
Go Completions | 1271 |
Nim Completions | 23 |
Rust Completions | 608 |
Reason Completions | 7 |
Racket Completions | 36 |
Haxe Completions | 14 |
Pascal Completions | 29 |
Perl Completions | 28 |
D Completions | 10 |
COBOL Completions | 9 |
Erlang Completions | 22 |
Total Stars | 570 |
% of votes with a positive feedback rating | 80% of 3571 |
Total "Very Satisfied" Votes | 2487 |
Total "Somewhat Satisfied" Votes | 741 |
Total "Not Satisfied" Votes | 343 |