Solve: Every Nth
Imported By: Geoffrey Challen
/ Version: 2021.4.0
Given a non-empty String
and an Int
N, return the String
made starting with Char
0,
and then every Nth Char
of the String
.
So if N is 3, use char
0, 3, 6, ... and so on. N is 1 or more.
For this problem we're expecting only a method.
Don't define a class, include modifiers like static or public, add import statements, or add code outside the method declaration.fun everyNth(
input: String,
n: Int,
): String {
return ""
}