This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string LongestPalindrome(string s) | |
{ | |
if (s.Length == 0 || s.Length==1) | |
return s; | |
var longestPali = s[0].ToString(); | |
for (var i = 0; i < s.Length; i++) | |
{ | |
//Walk backward until you find the same character then start looking for a palindrome |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int LengthOfLongestSubstring(string s) | |
{ | |
if(s.Length == 0) | |
return 0; | |
if (s.Length == 1) | |
return 1; | |
var maxLength = 1; | |
var curLength = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* A [--|--] | |
* B [--|--] | |
*/ | |
[Test] | |
public void AllOfAIsLessThanB() | |
{ | |
var nums1 = new int[]{1,2,3,4}; | |
var nums2 = new int[]{10,11,12,13,14}; | |
var appended = new int[] {1, 2, 3, 4, 10, 11, 12, 13, 14}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM public.ecr.aws/lambda/dotnet:5.0 | |
#You can alternately also pull these images from DockerHub amazon/aws-lambda-dotnet:5.0 | |
# Copy function code | |
COPY net5-lambda-template/bin/Debug/net5.0 ${LAMBDA_TASK_ROOT} | |
# Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) | |
CMD [ "net5-lambda-template::net5_lambda_template.LambdaFunction::Handler" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ListNode | |
{ | |
public int val; | |
public ListNode next; | |
public ListNode(int val = 0, ListNode next = null) | |
{ | |
this.val = val; | |
this.next = next; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace LeetCode | |
{ | |
public class TwoSum_Problem | |
{ | |
public static int[] TwoSum(int[] nums, int target) | |
{ | |
for (int i = 0; i < nums.Length; i++) | |
{ | |
for (int j = i+1; j < nums.Length; j++) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<pre class="code"><code class="@Language"> | |
@ChildContent | |
</code></pre> | |
@code { | |
[Inject] private IJSRuntime _js { get; set; } | |
[Parameter] public RenderFragment ChildContent { get; set; } | |
[Parameter] public string Language { get; set; } = "csharp"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 0.2 | |
phases: | |
build: | |
commands: | |
- set -e | |
- docker-compose up -d site | |
- docker cp serverless-blazor:/app/ServerlessBlazor/build/wwwroot . | |
- docker-compose down | |
- aws s3 sync ./wwwroot s3://<YOUR S3 BUCKET NAME> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 0.2 | |
phases: | |
build: | |
commands: | |
- set -e | |
- mkdir ./build | |
- cp ./public/** ./build | |
- aws s3 sync ./build s3://simple-cloud-formation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:latest | |
ENV TERM xterm-256color | |
WORKDIR /root | |
RUN apt-get update \ | |
&& apt-get install -y \ | |
ripgrep \ | |
jq \ | |
zsh \ | |
curl \ | |
git |
NewerOlder