6 kyu

Tricky Kotlin #0: extension constructor

Description:

This is a series of Kotlin tricks.

As we all know, Kotlin supports something called extension methods, which means you can add some methods to some existing classes.

In this Kata, you should make some extension constructor. For example, you can add a constructor to kotlin.Int that accepts a String and parse the string to int.

You should add such extension constructor to kotlin.Int, kotlin.Long, kotlin.Double.

Fundamentals

Stats:

CreatedSep 9, 2017
PublishedSep 9, 2017
Warriors Trained752
Total Skips133
Total Code Submissions810
Total Times Completed220
Kotlin Completions220
Total Stars18
% of votes with a positive feedback rating91% of 54
Total "Very Satisfied" Votes48
Total "Somewhat Satisfied" Votes2
Total "Not Satisfied" Votes4
Total Rank Assessments6
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • ice1000 Avatar
  • Voile Avatar
Ad