Write a recursive function that searches for a target in a sorted array using binay search, where the array, its size and the target are given as parameters.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'httparty' | |
require 'sinatra' | |
require 'securerandom' | |
require 'json' | |
get '/' do | |
erb :index | |
end | |
get '/redirect_auth_url' do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO | |
# add employee and patient ID numbers - in case two people with the same name are both employees or patients | |
# AUTH process | |
class Hospital | |
attr_reader :name, :location, :employees, :patients | |
def initialize(args) | |
@name = args[:name] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# What classes do you need? | |
# Remember, there are four high-level responsibilities, each of which have multiple sub-responsibilities: | |
require 'csv' | |
class Todo | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BoggleBoard | |
def initialize(boggle_board) | |
@boggle_board = boggle_board | |
end | |
def create_word(board, *coords) | |
coords.map { |coord| board[coord.first][coord.last]}.join("") | |
end | |
NewerOlder