Skip to content

Search Insert Position-Wrong answe

I’m solving a problem (leetcode 35). My code was accepted in run code result but when I submit it returns wrong answer.I don’t really understand what is wrong in my answer . Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be…

React window is not closing when the user clicks the button

I open a React web app like this in my index.js file: I then want the user to be able to close it, but close button doesn’t work. Here is the Review component: When I click it to close, nothing happens. Is there something I am not doing correctly? Thanks! Answer You’re not calling it as a function…

Color gradient renders as black

I’m attempting to use paper.js with javascript directly: http://paperjs.org/tutorials/getting-started/using-javascript-directly/ and cannot get gradients to work. Instead of a color gradient the line just appears to be black. This occurs for all shapes, so I’m pretty sure I’m somehow setting…

How @Inject(REQUEST) works and how to destructure it

The first question is how it’s possible that an injected parameter is changing after the class initialization. Because this code works and this code doesn’t work The second example doesn’t have ‘userId’ yet that should be injected by my nest.js interceptor. Why it’s like th…