Skip to content

Instantly share code, notes, and snippets.

from __future__ import annotations
import json
import textwrap
import typing
from timeit import timeit
import attr
import sys
@foxwhite25
foxwhite25 / solution.go
Created December 5, 2022 10:10
AOC-2022-Day5
package main
import (
"io/ioutil"
"regexp"
"strconv"
"strings"
)
type Stack []string
@foxwhite25
foxwhite25 / solution.go
Created December 6, 2022 09:40
AOC-2022-Day6
package main
import (
"io/ioutil"
"strings"
)
func main() {
input, err := ioutil.ReadFile("./6/input.txt")
if err != nil {
@foxwhite25
foxwhite25 / solution.go
Created December 7, 2022 08:46
AOC-2022-Day7
package main
import (
"io/ioutil"
"strconv"
"strings"
)
type Folder struct {
Name string
@foxwhite25
foxwhite25 / solution.go
Last active December 8, 2022 18:56
AOC-2022-Day8
package main
import (
"io/ioutil"
"strings"
)
func reverse(s []int) []int {
r := make([]int, len(s))
for i := 0; i < len(s); i++ {
@foxwhite25
foxwhite25 / solution.go
Created December 9, 2022 06:26
AOC-2022-Day9
package main
import (
"io/ioutil"
"regexp"
"strconv"
"strings"
)
type Coordinate struct {
You are an agent designed to interact with a SQL database.
Given an input question, create a syntactically correct sqlite query to run, then look at the results of the query and return the answer.
Unless the user specifies a specific number of examples they wish to obtain, always limit your query to at most 10 results.
You can order the results by a relevant column to return the most interesting examples in the database.
Never query for all the columns from a specific table, only ask for the relevant columns given the question.
You have access to tools for interacting with the database.
Only use the below tools. Only use the information returned by the below tools to construct your final answer.
You MUST double check your query before executing it. If you get an error while executing a query, rewrite the query and try again.
DO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database.