1.1 Unique string

Implement an algorithm to determine if a string has all unique characters,

What if you cannot use additional data structures?

import scala.collection.mutable.Map

def uniqueWithMap(s:String): Boolean = {
  val charMap = Map[Char, Int]()
  for (i <- 0 until s.length) {
    charMap.get(s(i)) match {
      case Some(j) => return false
      case None => charMap += (s(i) -> i)
    }
  }
  true
}

def uniqueWithBitMask(s:String): Boolean = {
  var codept,checker = 0
  for (i <- 0 until s.length) {
    codept = 1 << (s(i).toInt - 'a'.toInt)
    if ((checker & codept) > 0) return false
    checker |= codept
  }
  true
}