Let's imagine we have a very simple AST for programming language with only functions and calls use std::sync::Arc; struct Function { pub body: V ...
Let's imagine we have a very simple AST for programming language with only functions and calls use std::sync::Arc; struct Function { pub body: V ...
I was solving a question today on Leetcode named Lexicographically Smallest Equivalent String (link) and I came up with a solution of DFS with some cu ...
I need to build a sql query to find the least expensive squad (salary-wise) for teams in a European volleyball league. For each team, the squad consi ...
The program returns Boolean also working if I print the variable inside base condition but it is not print the same outside the function.Im really c ...
I am now using lists to represent the graph, which would be similar to previous question. I found out that the dict approach would be very long and co ...
Here I have initialized variables i , j , k , l to track the left child and right child bracket in the string. I , J are the range of the node for a ...
As an exercise, I tried to construct an infinite, lazy list, recursively, inside a monad. Basically, the equivalent of nat, but monadic, monat: nat ...
I want to build NFAs that match strings. I have: data State = State Char State | Split State State | Final Note that State can be infinitely recurs ...
So lets say I have a bunch of data that is not really known how is structured except that it is a combination of lists, dictionaries and string values ...
For a project I'm working on (an implementation of an obscure programming language), I have an enum Data, which represents data the interpreter is kee ...
Write a function canSum(targetSum, numbers) that takes in a targetSum and an array of numbers as arguments. The function should return a boolean indi ...
I want to write data with headers into a file. The first three lines are unique, and can be considered as a 'block' which are then repeated with incre ...
. Answers to this question are eligible for a +150 reputation bounty. B ...
I have a json file that looks like this: I need a recursive function that will build a single dataframe that contains 4 fields out of a json file o ...
I'm trying to do what I did in the example below, but on a large scale so Ideally the solution is as efficient as possible. Thanks in advance! Func ...
I have an array with items of type variant that I want to iterator over using the generic std::array iterator. Now I want to do the management of the ...
This MWE in the past would cause a stack overflow, as x references y that references x: class Ref: def __init__(self, name): self.name = ...
In "exploreComponent" function count is increasing according to the no. of nodes present in that Component but before returning count decreases to 1, ...
Prerequisites: I have a general tree class with: myTree = new Tree(string), appendChildNode(node), createChildNode(string)->node, myTree.print() fu ...
I have an unknown depth recursive object and I need to delete specific nodes and bring their children into their place... That might not make sense so ...