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 Foundation | |
func sockMerchant(n: Int, ar: [Int]) -> Int { | |
var sockBag: Set<Int> = [] | |
var totalPairs: Int = 0 | |
for sock in ar{ | |
if sockBag.contains(sock){ | |
sockBag.remove(sock) | |
totalPairs += 1 |
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 Foundation | |
struct PlusMinusRatio{ | |
var numberOfValues: [Double] | |
var elements: Double | |
var precision: Int | |
init(numberOfElements: Int, decimals: Int = 6) { | |
elements = Double(numberOfElements) | |
numberOfValues = [0.0, 0.0, 0.0] //Positives, Negatives, Zeros |
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
#Go into iex. Create and run the functions that do the following: | |
# list_concat.([:a, :b], [:c, :d]) #=> [:a, :b, :c, :d] | |
# sum.(1, 2, 3) #=> 6 | |
# pair_tuple_to_list.( { 1234, 5678 } ) #=> [ 1234, 5678 ] | |
defmodule Exercise1 do | |
#list_concat = fn a,b -> a ++ b end | |
def list_concat(a,b) do | |
a ++ b | |
end |
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
using System.IO; | |
namespace Calculadora{ | |
public partial class Form1 : Form{ | |
public Form1(){ | |
InitializeComponent(); | |
} |