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
# @param {String[]} strs | |
# @return {String} | |
def longest_common_prefix(strs) | |
strs = strs.sort | |
first = strs[0] | |
last = strs[strs.length - 1] | |
string = "" | |
first.length.times do |index| | |
if first[index] == last[index] |
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
# @param {String[]} strs | |
# @return {String} | |
def longest_common_prefix(strs) | |
return "" if strs.length == 0 | |
return strs[0] if strs.length == 1 | |
min_length = strs[0].length | |
strs.each do |str| | |
min_length = [min_length, str.length].min | |
end |
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
class Node { | |
constructor(val, priority) { | |
this.val = val | |
this.priority = priority | |
} | |
} | |
class PriorityQueue { | |
constructor() { | |
this.data = [] |
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
{ | |
"data_name": "nghiep", | |
"data_version": "1.0", | |
"emoticons": [ | |
{ | |
"key": "(suynghi)", | |
"src": "https://i.imgur.com/L9r2Wek.png" | |
}, | |
{ | |
"key": "(meohaha)", |
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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:padding="10dp" | |
android:orientation="vertical" | |
tools:context=".MainActivity"> |
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
import java.awt.Component; | |
import java.awt.Dimension; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import java.awt.event.MouseAdapter; | |
import java.awt.event.MouseEvent; | |
import java.util.ArrayList; | |
import javax.swing.BoxLayout; | |
import javax.swing.JButton; |
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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package luyentap2; | |
import java.util.Arrays; | |
import java.util.Scanner; |
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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package javaapplication1; | |
import java.util.Scanner; | |
/** |
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
sudo docker-compose build | |
db uses an image, skipping | |
Building web | |
Step 1/13 : FROM ruby:2.6-alpine | |
---> 6ddb199f039f | |
Step 2/13 : RUN apk update -qq && apk add nodejs postgresql-client gcc make ruby-dev | |
---> Running in fc796ed75f6a | |
(1/21) Installing binutils (2.32-r0) | |
(2/21) Installing isl (0.18-r0) | |
(3/21) Installing libgomp (8.3.0-r0) |
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
<%= @questions.each.with_index(1) do |q, index| %> | |
<div><strong><%= index %>.  <%= q.name %></strong></div> | |
<%#= question.answers.each do |answer| %> | |
<div><%#= answer.content %></div> | |
<%# end %> | |
<%= fields_for q do |ff| %> | |
<div class="answers-list"> | |
<% if q.is_multi? %> | |
<%= q.answers.each do |a| %> | |
<div> |
NewerOlder