title: How to solve HackerRank problems in Objective-C
body: <p>Can anybody explain how to give the hacker rank test in objective-C. Specially the part "Read input from STDIN. Print output to STDOUT"</p>
  
  <p>How to read input and out in objective-c ?</p>
  
  <p>What i have got so far is get input like</p>
  
  <pre><code> NSFileHandle *fileHandler = [NSFileHandle fileHandleWithStandardInput];
   NSData *inputData = [fileHandler availableData];
   NSString *inputString = [[NSString alloc] initWithData:inputData encoding:NSUTF8StringEncoding];
  </code></pre>
  
  <p>But to print output, following does not print anything on HackerRank console (but works flawlessly on Xcode console)</p>
  
  <pre><code>NSFileHandle* fileHandler=[NSFileHandle fileHandleWithStandardOutput];
  [fileHandler writeData: [formattedString dataUsingEncoding: NSNEXTSTEPStringEncoding]];
  </code></pre>