Skip to content

Instantly share code, notes, and snippets.

View Roshankumar350's full-sized avatar
🎯
Focusing

Roshan Kumar Sah Roshankumar350

🎯
Focusing
View GitHub Profile
func findIndexOf(targetSum sum: Int, in inputArray: [Int]) -> (Int,Int) {
//Output index
var indices: (Int,Int) = (-1, -1)
//count of input array
let inputArrayCount = inputArray.count
for (index, eachElement) in inputArray.enumerated() {
for sartIndex in index..<inputArrayCount {
if eachElement + inputArray[sartIndex] == sum {
@Roshankumar350
Roshankumar350 / ios-interview-resources.md
Created October 15, 2020 16:56 — forked from funmia/ios-interview-resources.md
General iOS, CS questions and interview prep resources.
@Roshankumar350
Roshankumar350 / Cost_of_balloons.txt
Last active February 17, 2021 17:31
Cost of balloons : HackerEarth
// Write your code here
func solve() {
// know the cost of balloons
let costOfBallons = getArray(readLine()!)
// know the number of participants
let numberOfParticipant = Int(readLine()!)!
// some holder to capture who has solved the problem
var firstParticipantSolved = 0