Leetcode Short [Rust | Vim] - A ListNode Utility (To Solve Problem 21)

preview_player
Показать описание
I'm working my way through the "Grind 75" Leetcode problems, as a sort of warmup to Advent of Code coming in December 2022. Be amazed at my solutions! Poke holes in my logic! Come up with tests that break my code!

In this one, we take a break from solving problems in order to implement the struct that's given in the problem we're trying to solve. The next video in the playlist is the one that actually uses the ListNode struct to solve a problem.

#rust #rustlang #programming #leetcode
Рекомендации по теме
Комментарии
Автор

I would probably go with the ‹From› trait :) but I can see the issue with mismatched types :/
also regarding the tests, it is dependant on your implementation, if you were building the linked list from the start and used the same tests, it would be false negative if the created list was shorter

mtt_
Автор

What is that test runner you are using ?

swastikacharyya