This file contains hidden or 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
| def is_valid_state(state): | |
| # check if it is a valid solution | |
| return True | |
| def get_candidates(state): | |
| return [] | |
| def search(state, solutions): | |
| if is_valid_state(state): | |
| solutions.append(state.copy()) |
This file contains hidden or 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
| import PlaygroundSupport | |
| import Foundation | |
| let url = URL(string: "https://my-json-server.typicode.com/shadmazumder/demo/db") | |
| let task = URLSession.shared.dataTask(with: url!) { (data, response, error) in | |
| "Response: " + response.debugDescription | |
This file contains hidden or 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
| //: Playground - noun: a place where people can play | |
| import Foundation | |
| struct Service{ | |
| static func execute() -> URLSessionDataTask? { | |
| guard let url = URL(string: "https://jsonplaceholder.typicode.com/users/1") else { return nil} | |