Language

Rust archive

The subset of the library that currently has Rust code or a Rust solution link.

812 entries

This is the Rust-first slice of the archive, useful when you want the multilingual subset only.

04.01.2025

medium

1930. Unique Length-3 Palindromic Subsequences

Count palindromes of length 3

building a HashSet can be slower then just checking for contains 26 times using unordered_set to count unique characters in the substring finding the span between first and last occurrences of a character counting unique characters within the substring defined by character occurrences manipulating and analyzing string content implicit use of string as an array of characters

27.08.2024

medium

1514. Path with Maximum Probability

Max path in a weighted graph

g queue shortest path calculation via probability multiplication using a priority queue (implicitly via BFS/queue structure) to find paths with maximum probability, updating probabilities based on multiplicative factors. building an adjacency list representation for the graph where edges store transition probabilities. weighted directed/undirected graph with probability weights