Skip to content

Latest commit

 

History

History
14 lines (13 loc) · 2.09 KB

82-find-the-capitals.md

File metadata and controls

14 lines (13 loc) · 2.09 KB

Problem:

Instructions

Write a function that takes a single string (word) as argument. The function must return an ordered list containing the indexes of all capital letters in the string.

Example

Test.assertSimilar( capitals('CodEWaRs'), [0,3,4,6] );
Test.assert_equals( capitals('CodEWaRs'), [0,3,4,6] );
capitals ""         `shouldBe` []
capitals "CodEWaRs" `shouldBe` [0,3,4,6]
capitals "aAbB"     `shouldBe` [1,3]
capitals "4ysdf4"   `shouldBe` []
capitals "ABCDEF"   `shouldBe` [0..5]
Assert.AreEqual(Kata.Capitals("CodEWaRs"), new int[]{0,3,4,6});

Solution