title: Find Position Given Number Among Numbers Made 4 7
signature: def findPositionGivenNumberAmongNumbersMade47(n: String) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Int , expected: Int): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(n: String, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        "7", 
        2    
      )}")   
  
  
      println(s"TEST-1...${driver(
        "305745689", 
        5    
      )}")   
  
  
      println(s"TEST-2...${driver(
        "444", 
        7    
      )}")   
  
  
      println(s"TEST-3...${driver(
        "4", 
        1    
      )}")   
  
  
      println(s"TEST-4...${driver(
        "2074", 
        5    
      )}")   
  
  
      println(s"TEST-5...${driver(
        "27", 
        2    
      )}")   
  
  
      println(s"TEST-6...${driver(
        "447", 
        8    
      )}")   
  
  
      println(s"TEST-7...${driver(
        "255", 
        0    
      )}")   
  
  
      println(s"TEST-8...${driver(
        "10000111111011", 
        0    
      )}")   
  
  
      println(s"TEST-9...${driver(
        "fAKcSDRTNz", 
        0    
      )}")   
  
  }
  
source_py: def find_position_given_number_among_numbers_made_4_7(n):
      i = 0
      j = len(n)
      pos = 0
      while (i < j):
          if (n[i] == '4'):
              pos = ((pos * 2) + 1)
          if (n[i] == '7'):
              pos = ((pos * 2) + 2)
          i = (i + 1)
      return pos
source_cpp: int find_position_given_number_among_numbers_made_4_7(string n) {
    int i = 0, pos = 0;
    while ( n [ i ] != '\0' ) {
      switch ( n [ i ] ) {
        case '4' : pos = pos * 2 + 1;
        break;
        case '7' : pos = pos * 2 + 2;
        break;
      }
      i ++;
    }
    return pos;
  }