From 31a88c23e0776512b9eaf4f1e9c28b65d57f83eb Mon Sep 17 00:00:00 2001 From: Adarsh Aniket <84972243+Adarsh-17@users.noreply.github.com> Date: Fri, 27 Nov 2026 10:00:37 +0000 Subject: [PATCH 01/12] [Sync Iteration] javascript/hello-world/1 --- solutions/javascript/hello-world/1/hello-world.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 solutions/javascript/hello-world/1/hello-world.js diff --git a/solutions/javascript/hello-world/1/hello-world.js b/solutions/javascript/hello-world/1/hello-world.js new file mode 100644 index 0000000..9943207 --- /dev/null +++ b/solutions/javascript/hello-world/1/hello-world.js @@ -0,0 +1,7 @@ +// +// This is only a SKELETON file for the 'Hello World' exercise. It's been provided as a +// convenience to get you started writing code faster. +// +export function hello() { + return 'Hello, World!'; +} From 6d77fdfa49f3a4bce674418dea5785457221399c Mon Sep 17 00:00:00 2001 From: Adarsh Aniket <84972243+Adarsh-17@users.noreply.github.com> Date: Fri, 27 Nov 2026 10:00:38 +0000 Subject: [PATCH 02/12] [Sync Iteration] go/hello-world/1 --- solutions/go/hello-world/1/hello_world.go | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 solutions/go/hello-world/1/hello_world.go diff --git a/solutions/go/hello-world/1/hello_world.go b/solutions/go/hello-world/1/hello_world.go new file mode 100644 index 0000000..28c166c --- /dev/null +++ b/solutions/go/hello-world/1/hello_world.go @@ -0,0 +1,6 @@ +package greeting + +// HelloWorld greets the world. +func HelloWorld() string { + return "Hello, World!" +} From 0403cd5d5b4b0ae115cbecd795b47b1af6b70150 Mon Sep 17 00:00:00 2001 From: Adarsh Aniket <84972243+Adarsh-17@users.noreply.github.com> Date: Fri, 27 Nov 2026 10:00:38 +0000 Subject: [PATCH 03/12] [Sync Iteration] go/lasagna/1 --- solutions/go/lasagna/1/lasagna.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 solutions/go/lasagna/1/lasagna.go diff --git a/solutions/go/lasagna/1/lasagna.go b/solutions/go/lasagna/1/lasagna.go new file mode 100644 index 0000000..b1d6883 --- /dev/null +++ b/solutions/go/lasagna/1/lasagna.go @@ -0,0 +1,19 @@ +package lasagna + +// OvenTime constant defines the expected oven time in minutes +const OvenTime = 40 + +// RemainingOvenTime returns the remaining minutes based on the `actual` minutes already in the oven. +func RemainingOvenTime(actualMinutesInOven int) int { + return OvenTime - actualMinutesInOven +} + +// PreparationTime calculates the time needed to prepare the lasagna based on the amount of layers. +func PreparationTime(numberOfLayers int) int { + return numberOfLayers * 2 +} + +// ElapsedTime calculates the total time spent preparing and baking the lasagna. +func ElapsedTime(numberOfLayers, actualMinutesInOven int) int { + return PreparationTime(numberOfLayers) + actualMinutesInOven +} From 75df787c5ee3417fce52320675554aa4dbd0ee9a Mon Sep 17 00:00:00 2001 From: Adarsh Aniket <84972243+Adarsh-17@users.noreply.github.com> Date: Fri, 27 Nov 2026 10:00:39 +0000 Subject: [PATCH 04/12] [Sync Iteration] go/annalyns-infiltration/1 --- .../1/annalyns_infiltration.go | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 solutions/go/annalyns-infiltration/1/annalyns_infiltration.go diff --git a/solutions/go/annalyns-infiltration/1/annalyns_infiltration.go b/solutions/go/annalyns-infiltration/1/annalyns_infiltration.go new file mode 100644 index 0000000..a0b28b1 --- /dev/null +++ b/solutions/go/annalyns-infiltration/1/annalyns_infiltration.go @@ -0,0 +1,23 @@ +package annalyn + +// CanFastAttack can be executed only when the knight is sleeping. +func CanFastAttack(knightIsAwake bool) bool { + return !knightIsAwake +} + +// CanSpy can be executed if at least one of the characters is awake. +func CanSpy(knightIsAwake, archerIsAwake, prisonerIsAwake bool) bool { + return knightIsAwake || archerIsAwake || prisonerIsAwake +} + +// CanSignalPrisoner can be executed if the prisoner is awake and the archer is sleeping. +func CanSignalPrisoner(archerIsAwake, prisonerIsAwake bool) bool { + return !archerIsAwake && prisonerIsAwake +} + +// CanFreePrisoner can be executed if the prisoner is awake and the other 2 characters are asleep +// or if Annalyn's pet dog is with her and the archer is sleeping. +func CanFreePrisoner(knightIsAwake, archerIsAwake, prisonerIsAwake, petDogIsPresent bool) bool { + return (prisonerIsAwake && !knightIsAwake && !archerIsAwake) || (petDogIsPresent && !archerIsAwake) +} + From 304c2f8555792bbe540d4fb563acb1adc418dac6 Mon Sep 17 00:00:00 2001 From: Adarsh Aniket <84972243+Adarsh-17@users.noreply.github.com> Date: Fri, 27 Nov 2026 10:00:39 +0000 Subject: [PATCH 05/12] [Sync Iteration] go/party-robot/1 --- solutions/go/party-robot/1/party_robot.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 solutions/go/party-robot/1/party_robot.go diff --git a/solutions/go/party-robot/1/party_robot.go b/solutions/go/party-robot/1/party_robot.go new file mode 100644 index 0000000..28e76c7 --- /dev/null +++ b/solutions/go/party-robot/1/party_robot.go @@ -0,0 +1,20 @@ +package partyrobot + +import "fmt" + +// Welcome greets a person by name. +func Welcome(name string) string { + return fmt.Sprintf("Welcome to my party, %s!", name) +} + +func HappyBirthday(name string, age int) string { + return fmt.Sprintf("Happy birthday %s! You are now %d years old!", name, age) +} + +func AssignTable(name string, table int, neighbor, direction string, distance float64) string { + return fmt.Sprintf( + "Welcome to my party, %s!\nYou have been assigned to table %03d. Your table is %s, exactly %.1f meters from here.\nYou will be sitting next to %s.", + name, table, direction, distance, neighbor, + ) +} + From d12d8d1e019a41075cd59b14acd4b0779f863415 Mon Sep 17 00:00:00 2001 From: Adarsh Aniket <84972243+Adarsh-17@users.noreply.github.com> Date: Fri, 27 Nov 2026 10:00:39 +0000 Subject: [PATCH 06/12] [Sync Iteration] go/weather-forecast/1 --- solutions/go/weather-forecast/1/weather_forecast.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 solutions/go/weather-forecast/1/weather_forecast.go diff --git a/solutions/go/weather-forecast/1/weather_forecast.go b/solutions/go/weather-forecast/1/weather_forecast.go new file mode 100644 index 0000000..c7bbb1f --- /dev/null +++ b/solutions/go/weather-forecast/1/weather_forecast.go @@ -0,0 +1,13 @@ +//Package weather provides tools to get forecast. +package weather + +//CurrentCondition stores the current condition. +var CurrentCondition string +//CurrentLocation stores the current location. +var CurrentLocation string + +//Forecast returns weather forecast. +func Forecast(city, condition string) string { + CurrentLocation, CurrentCondition = city, condition + return CurrentLocation + " - current weather condition: " + CurrentCondition +} From 4d45aeb90297d11472937bc74fd3fabee2399c62 Mon Sep 17 00:00:00 2001 From: Adarsh Aniket <84972243+Adarsh-17@users.noreply.github.com> Date: Fri, 27 Nov 2026 10:00:40 +0000 Subject: [PATCH 07/12] [Sync Iteration] go/blackjack/1 --- solutions/go/blackjack/1/blackjack.go | 53 +++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 solutions/go/blackjack/1/blackjack.go diff --git a/solutions/go/blackjack/1/blackjack.go b/solutions/go/blackjack/1/blackjack.go new file mode 100644 index 0000000..9038a77 --- /dev/null +++ b/solutions/go/blackjack/1/blackjack.go @@ -0,0 +1,53 @@ +package blackjack + +// ParseCard returns the integer value of a card following blackjack ruleset. +func ParseCard(card string) int { + switch card { + case "ace": + return 11 + case "two": + return 2 + case "three": + return 3 + case "four": + return 4 + case "five": + return 5 + case "six": + return 6 + case "seven": + return 7 + case "eight": + return 8 + case "nine": + return 9 + case "ten", "jack", "queen", "king": + return 10 + default: + return 0 + } +} + + +// FirstTurn returns the decision for the first turn, given two cards of the +// player and one card of the dealer. +func FirstTurn(card1, card2, dealerCard string) string { + value := ParseCard(card1) + ParseCard(card2) + if ParseCard(card1) == 11 && ParseCard(card2) == 11{ + return "P" + }else if value == 21 { + if ParseCard(dealerCard) >= 10{ + return "S" + } + return "W" + }else if value<=20 && value>=17 { + return "S" + }else if value<=16 && value >=12 { + if ParseCard(dealerCard) >= 7{ + return "H" + } + return "S" + }else{ + return "H" + } +} From f56987e5a9843a482d7b1efa9db848d184aedc83 Mon Sep 17 00:00:00 2001 From: Adarsh Aniket <84972243+Adarsh-17@users.noreply.github.com> Date: Fri, 27 Nov 2026 10:00:40 +0000 Subject: [PATCH 08/12] [Sync Iteration] go/booking-up-for-beauty/1 --- .../1/booking_up_for_beauty.go | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 solutions/go/booking-up-for-beauty/1/booking_up_for_beauty.go diff --git a/solutions/go/booking-up-for-beauty/1/booking_up_for_beauty.go b/solutions/go/booking-up-for-beauty/1/booking_up_for_beauty.go new file mode 100644 index 0000000..895d435 --- /dev/null +++ b/solutions/go/booking-up-for-beauty/1/booking_up_for_beauty.go @@ -0,0 +1,54 @@ +package booking + +import ( + "fmt" + "time" +) + +// Schedule returns a time.Time from a string containing a date. +func Schedule(date string) time.Time { + layout := "1/2/2006 15:04:05" + t, err := time.Parse(layout, date) + if err != nil { + return time.Time{} + } + return t +} + +// HasPassed returns whether a date has passed. +func HasPassed(date string) bool { + layout := "January 2, 2006 15:04:05" + t, err := time.Parse(layout, date) + if err != nil { + return false + } + return t.Before(time.Now()) +} + +// IsAfternoonAppointment returns whether a time is in the afternoon. +func IsAfternoonAppointment(date string) bool { + layout := "Monday, January 2, 2006 15:04:05" + t, err := time.Parse(layout, date) + if err != nil { + return false + } + hour := t.Hour() + return hour >= 12 && hour < 18 +} + +// Description returns a formatted string of the appointment time. +func Description(date string) string { + layout := "1/2/2006 15:04:05" + t, err := time.Parse(layout, date) + if err != nil { + return "Invalid date format" + } + formatted := t.Format("Monday, January 2, 2006, at 15:04") + return fmt.Sprintf("You have an appointment on %s.", formatted) +} + +// AnniversaryDate returns a Time with this year's anniversary on Sept 15 at 00:00 UTC. +func AnniversaryDate() time.Time { + year := time.Now().Year() + return time.Date(year, time.September, 15, 0, 0, 0, 0, time.UTC) +} From baecec47bcad26e5eb0b4e29775c524293d1fcbd Mon Sep 17 00:00:00 2001 From: Adarsh Aniket <84972243+Adarsh-17@users.noreply.github.com> Date: Fri, 27 Nov 2026 10:00:40 +0000 Subject: [PATCH 09/12] [Sync Iteration] go/cars-assemble/1 --- solutions/go/cars-assemble/1/cars_assemble.go | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 solutions/go/cars-assemble/1/cars_assemble.go diff --git a/solutions/go/cars-assemble/1/cars_assemble.go b/solutions/go/cars-assemble/1/cars_assemble.go new file mode 100644 index 0000000..8bdde96 --- /dev/null +++ b/solutions/go/cars-assemble/1/cars_assemble.go @@ -0,0 +1,21 @@ +package cars + +// CalculateWorkingCarsPerHour calculates how many working cars are +// produced by the assembly line every hour. +func CalculateWorkingCarsPerHour(productionRate int, successRate float64) float64 { + var dec float64 = successRate/100 + return dec * float64(productionRate) +} + +// CalculateWorkingCarsPerMinute calculates how many working cars are +// produced by the assembly line every minute. +func CalculateWorkingCarsPerMinute(productionRate int, successRate float64) int { + return int(CalculateWorkingCarsPerHour(productionRate, successRate)/float64(60)) +} + +// CalculateCost works out the cost of producing the given number of cars. +func CalculateCost(carsCount int) uint { + div := uint(carsCount/10) + rem := uint(carsCount%10) + return div*95000 + rem*10000 +} From d6fc9087620b75d2efeefd68e113bf52b97302cf Mon Sep 17 00:00:00 2001 From: Adarsh Aniket <84972243+Adarsh-17@users.noreply.github.com> Date: Fri, 27 Nov 2026 10:00:40 +0000 Subject: [PATCH 10/12] [Sync Iteration] go/gross-store/1 --- solutions/go/gross-store/1/gross_store.go | 70 +++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 solutions/go/gross-store/1/gross_store.go diff --git a/solutions/go/gross-store/1/gross_store.go b/solutions/go/gross-store/1/gross_store.go new file mode 100644 index 0000000..c2230e6 --- /dev/null +++ b/solutions/go/gross-store/1/gross_store.go @@ -0,0 +1,70 @@ +package gross + +// Units stores the Gross Store unit measurements. +func Units() map[string]int { + units := make(map[string]int) + + units["quarter_of_a_dozen"] = 3 + units["half_of_a_dozen"] = 6 + units["dozen"] = 12 + units["small_gross"] = 120 + units["gross"] = 144 + units["great_gross"] = 1728 + + return units +} + +// NewBill creates a new bill. +func NewBill() map[string]int { + bill := make(map[string]int) + return bill +} + + +// AddItem adds an item to customer bill. +func AddItem(bill, units map[string]int, item, unit string) bool { + unitValue, unitExists := units[unit] + if !unitExists { + return false + } + bill[item] += unitValue // add to existing quantity + return true +} + + +// RemoveItem removes an item from customer bill. +func RemoveItem(bill, units map[string]int, item, unit string) bool { + itemValue, itemExists := bill[item] + unitValue, unitExists := units[unit] + + // Check if item exists in bill and unit exists in units map + if !itemExists || !unitExists { + return false + } + + newValue := itemValue - unitValue + + if newValue < 0 { + // Can't have negative quantity + return false + } else if newValue == 0 { + // Remove item from bill + delete(bill, item) + return true + } else { + // Reduce item quantity + bill[item] = newValue + return true + } +} + + +// GetItem returns the quantity of an item that the customer has in his/her bill. +func GetItem(bill map[string]int, item string) (int, bool) { + quantity, exists := bill[item] + if !exists { + return 0, false + } + return quantity, true +} + From 4af61f58c1c9703bd9ef8e1af8eb4c1c0cca0236 Mon Sep 17 00:00:00 2001 From: Adarsh Aniket <84972243+Adarsh-17@users.noreply.github.com> Date: Fri, 27 Nov 2026 10:00:41 +0000 Subject: [PATCH 11/12] [Sync Iteration] go/vehicle-purchase/1 --- .../go/vehicle-purchase/1/vehicle_purchase.go | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 solutions/go/vehicle-purchase/1/vehicle_purchase.go diff --git a/solutions/go/vehicle-purchase/1/vehicle_purchase.go b/solutions/go/vehicle-purchase/1/vehicle_purchase.go new file mode 100644 index 0000000..046ab41 --- /dev/null +++ b/solutions/go/vehicle-purchase/1/vehicle_purchase.go @@ -0,0 +1,32 @@ +package purchase +import "fmt" + +// NeedsLicense determines whether a license is needed to drive a type of vehicle. Only "car" and "truck" require a license. +func NeedsLicense(kind string) bool { + if kind == "car" || kind == "truck" { + return true + } + return false +} + +// ChooseVehicle recommends a vehicle for selection. It always recommends the vehicle that comes first in lexicographical order. +func ChooseVehicle(option1, option2 string) string { + var chosen string + if option1 < option2 { + chosen = option1 + } else { + chosen = option2 + } + return fmt.Sprintf("%s is clearly the better choice.", chosen) +} + +// CalculateResellPrice calculates how much a vehicle can resell for at a certain age. +func CalculateResellPrice(originalPrice, age float64) float64 { + if age < 3 { + return originalPrice * 0.8 + } else if age >= 10 { + return originalPrice * 0.5 + } else { + return originalPrice * 0.7 + } +} From 0f437afdb8738504454db7316804f9fbcb74d010 Mon Sep 17 00:00:00 2001 From: Adarsh Aniket <84972243+Adarsh-17@users.noreply.github.com> Date: Fri, 27 Nov 2026 10:00:41 +0000 Subject: [PATCH 12/12] [Sync Iteration] python/hello-world/1 --- solutions/python/hello-world/1/hello_world.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 solutions/python/hello-world/1/hello_world.py diff --git a/solutions/python/hello-world/1/hello_world.py b/solutions/python/hello-world/1/hello_world.py new file mode 100644 index 0000000..dea05ae --- /dev/null +++ b/solutions/python/hello-world/1/hello_world.py @@ -0,0 +1,2 @@ +def hello(): + return "Hello, World!"