Skip to content

Instantly share code, notes, and snippets.

View Schockarum's full-sized avatar
💭
Bamboozled

Mau E. Vázquez Schockarum

💭
Bamboozled
View GitHub Profile
@Schockarum
Schockarum / 01_SalesByMatch.swift
Created January 13, 2022 04:40
HackerRank [Swift] 1 Month Preparation Kit - Week 2
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
@Schockarum
Schockarum / 01_PlusMinus.swift
Last active January 1, 2025 11:21
Hacker Rank [Swift] 1 Month Preparation Kit - Week 1 Algorithms
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
@Schockarum
Schockarum / Exercise1Functions1.ex
Last active November 11, 2019 18:57
Programming Elixir 1.2 Book - Exercise 1: Functions
#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
using System.IO;
namespace Calculadora{
public partial class Form1 : Form{
public Form1(){
InitializeComponent();
}