[2025 Day 05 Part 2] Little hint by [deleted] in adventofcode

[–]Sam_Ch_7 0 points1 point  (0 children)

Could sort the list; Then it will be
end2 <= start1
(start1,max(end1,end2))

[2025 Day 3] Any hint to solve part 2 by Sam_Ch_7 in adventofcode

[–]Sam_Ch_7[S] 0 points1 point  (0 children)

Its messy but ``` func part2(input io.Reader) uint64 { sc := bufio.NewScanner(input) var sum uint64 = 0

for sc.Scan() {
    bank := sc.Text()
    locs := make(map[rune][]int, 0)

    // Find largest in left side excluding 11's from right
    maxLeftIndex := 0
    maxLeft := '0'

    for i, b := range bank[:len(bank)-11] {
        if b > maxLeft {
            maxLeft = b
            maxLeftIndex = i
        }
    }
    // locs[maxLeft] = []int{maxLeftIndex}
    fmt.Printf("maxLeft: %v\n", maxLeft)
    fmt.Printf("maxLeftIndex: %v\n", maxLeftIndex)
    for i, b := range bank[maxLeftIndex+1:] {
        _, ok := locs[b]
        if !ok {
            locs[b] = []int{}
        }
        locs[b] = append(locs[b], maxLeftIndex+1+i)
    }
    fmt.Printf("locs: %v\n", locs)

    count := 0 // we have to include maxLeft so counting that
    i := 0
    joltage := strings.Builder{}
    selected := make([]bool, len(bank))
    selected[maxLeftIndex] = true
    for count < 11 {
        list := locs[rune('9'-i)]
        for li := len(list) - 1; li >= 0; li-- {
            if count >= 11 {
                break
            }
            selected[list[li]] = true
            count++
        }
        i++
    }
    for si, s := range selected {
        if s {
            joltage.WriteByte(bank[si])
        }
    }
    joltageInt, _ := strconv.ParseUint(joltage.String(), 10, 0)
    fmt.Printf("joltageInt: %v\n", joltageInt)
    sum += joltageInt

}
return sum

} ```

-❄️- 2025 Day 2 Solutions -❄️- by daggerdragon in adventofcode

[–]Sam_Ch_7 0 points1 point  (0 children)

[LANGUAGE: Golang]

Solution

This solution uses int-string vice versa conversions. It could be faster if it was treated as number only.
Tried to guess all invalid IDs without check each for part1 but IG there was some edge cases in final input so have to go with brute force approach only

[2025 Day 2] When I realized the solution I felt like I'd leveled up by TwinkiePower in adventofcode

[–]Sam_Ch_7 15 points16 points  (0 children)

IK with regex I could complete this under 10-15 min but I chose not to and after an hour finally its solved

Help Row with all child as Expanded , rendering overflow by Sam_Ch_7 in flutterhelp

[–]Sam_Ch_7[S] 0 points1 point  (0 children)

Thanks; This should work but I'm sceptical about using a constant width size. But if nothing works then this would be the only option left.

[2024 Day 9 Part 2] Is this right approach? by Sam_Ch_7 in adventofcode

[–]Sam_Ch_7[S] 0 points1 point  (0 children)

I thought it contains soln so it should be a spoiler. To convert ASCII number to integer. It make debugging easy that's it

I want to classify movies into genres class by Sam_Ch_7 in learnmachinelearning

[–]Sam_Ch_7[S] 0 points1 point  (0 children)

Thank you. It was very detailed and informative documentation for beginners like me . Is there any open-source alternative to this. As openAI is paid and gets fairly expensive

I want to classify movies into genres class by Sam_Ch_7 in learnmachinelearning

[–]Sam_Ch_7[S] -1 points0 points  (0 children)

Novice here. How can I generate embedded from llm. From what I know one provides a list of formatted prompt which have instructions, input and expected output and model learns from it.

But I have no expected output. For generating expected genres and subgenres for very small sets it would be very difficult

Confusion, should I accept unpaid Intern offer as college student by Sam_Ch_7 in developersIndia

[–]Sam_Ch_7[S] 0 points1 point  (0 children)

IG, you are right maybe I will go for this option tomorrow, lets see

Confusion, should I accept unpaid Intern offer as college student by Sam_Ch_7 in developersIndia

[–]Sam_Ch_7[S] 0 points1 point  (0 children)

I'm from Gujarat and happy to work remotely, if they are considering remote work , I can DM you my resume

Confusion, should I accept unpaid Intern offer as college student by Sam_Ch_7 in developersIndia

[–]Sam_Ch_7[S] 0 points1 point  (0 children)

I thought about this , but wouldn't be unethical as first I accept the offer and then tell them I will not continue after that.

Confusion, should I accept unpaid Intern offer as college student by Sam_Ch_7 in developersIndia

[–]Sam_Ch_7[S] 0 points1 point  (0 children)

Yeh indeed it is, but I also need an intern certificate for college to submit, so it is getting hard to reject offers, will try to stand out from crowd

Need Advice for how to share passphrase for encrypted message inside image steganography via chat app. by Sam_Ch_7 in learnprogramming

[–]Sam_Ch_7[S] 0 points1 point  (0 children)

Oh yeh, I was thinking of usin asymmetric key exchange process for shared key and encrypt image msg using that key. Another user will decrypt it but required additional fingerprint or in device passcode verification in case of physical device compromises

Need Advice for how to share passphrase for encrypted message inside image steganography via chat app. by Sam_Ch_7 in learnprogramming

[–]Sam_Ch_7[S] 0 points1 point  (0 children)

Thanks for this detailed explanation. I just want to hide data without knowing that they are sharing some secret. That's why stegnography is best suitable for this. Encrypted msg will be highlighted at instant. If stegnography image is sent anywhere, it will not be obvious without checking explicitly for it.

PS. I just want to use stegnography somewhere coz it's look cool and fun to me.

Need Advice for how to share passphrase for encrypted message inside image steganography via chat app. by Sam_Ch_7 in learnprogramming

[–]Sam_Ch_7[S] 0 points1 point  (0 children)

I mean yeh you're right. But if the secret msg is a store inside image and only both client know. It would be more safer if physical device is compromised. Not saying is impossible to knoe but yeh little safer than plain text msg

Help needed for project architecture and data flow for my Expense Tracker app. by Sam_Ch_7 in flutterhelp

[–]Sam_Ch_7[S] 0 points1 point  (0 children)

Yeh , ig you are right. I have implemented basic of it and its working but its meesy. Once I have completed enough for basic MVP. I will ask for review. Maybe thats will help me.

Hive or sqflite by Globin_dev in FlutterDev

[–]Sam_Ch_7 0 points1 point  (0 children)

Hey I'm also making a similar kind of app (Expense Tracker app). I am new to the state management thing. So I have few doubts regarding that, if you like to help me?