Grimson
Grimson
CC#
Created by Grimson on 8/2/2024 in #help
Optimizing a c# solution (algorithm)
Hi, our professor gave us this problem for uni https://observablehq.com/@mpcowan/day-6-universal-orbit-map as a challenge (not graded), and asked us if we can optimize the solution in any way. Do you guys have any opinion on how to do it? I have so far thought about caching the results of recursion but on further analysis, I realized that the recursion call never really repeats, so caching doesn't make sense. I am also reading up more about dynamic programming and matrix exponentiation but I am not sure how else I can optimize this. Do you guys have any hints or any idea?
10 replies
CC#
Created by Grimson on 8/2/2024 in #help
✅ Use of Unassigned local variable?
Hi, I am solving the advent of coding challenges for practice for uni and I have already finished the problem and now I am trying to optimize code. However, I I can't seem to figure out why I am getting use of unassigned local variable when I try to cache the results in a dictionary. I have already initialized the dictionary, so I don't know what the issue is. Can anyone help please? The problem is in program.cs file. URL : https://github.com/AnmolSinha1201/Orbit
7 replies
CC#
Created by Grimson on 7/30/2024 in #help
I can't get IApplicationBuilder to be not null in my test project
Hi, I am using xunit to add some test coverage to one of my projects. Furthermore, I am using Xunit.DependencyInjection to add inject correct services to my code. I believe I got that part working. However, I need to populate some data and use app.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope(); (which I lifted off some scaffolding from the original project to be tested) and I cannot get the app to be not null in Configure(IApplicationBuilder app) method. Please help!
3 replies