Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

TheRedRover Apr 8th, 2020 122 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. object Dups {
  2.   def duplicateCount(str: String): Int ={
  3.     def helper (str:String, acc:Int): Int ={
  4.       if(str.length>1) {
  5.         val str1 = str.toLowerCase.filterNot(str.toLowerCase.charAt(0).toString.toSet)
  6.         if(str.length-str1.length>1){
  7.           helper(str1,acc+1)
  8.         }
  9.         else helper(str1,acc)
  10.       }
  11.       else acc
  12.     }
  13.     helper(str,0)
  14.   }
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top