Book Review
This file contains hidden or 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
# Imports | |
!pip install qiskit | |
!pip install qiskit-aer | |
!pip install pylatexenc | |
# Quantum program | |
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, transpile | |
from qiskit_aer import Aer | |
from qiskit.visualization import plot_histogram | |
import matplotlib.pyplot as plt |
This file contains hidden or 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 Solution { | |
public int EvalRPN(string[] tokens) { | |
char[] operators = { '+', '-', '*', '/' }; | |
Stack<int> operands = new Stack<int>(); | |
foreach (string token in tokens) | |
{ | |
bool isOperator = token.Length == 1 && token.IndexOfAny(operators) != -1; | |
if (!isOperator) | |
{ |
If you are experiencing frequent disconnects when using a TP Link AX1800 Archer TX20U Plus Wifi Adapter, especially when connecting to an Xfinity Wifi Hotspot, it may be due to the Roaming Sensitivity Level. The following settings can fix this issue.
- In Windows, click Start.
This file contains hidden or 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
// Check if the figure can be placed at a specific row and column | |
const canPlaceFigure = (figure, field, startRow, startCol) => { | |
for (let i = 0; i < figure.length; i++) { | |
for (let j = 0; j < figure[0].length; j++) { | |
if (figure[i][j] === 1 && field[startRow + i][startCol + j] === 1) { | |
return false; // Conflict detected | |
} | |
} | |
} | |
return true; // Placement is possible |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body class="main"> | |
<h1>Frontend Task</h1> | |
<div> | |
<div id='left-box'><button id='left' class='btn-box left-shift-button'><<</button></div> | |
<div id='division'> | |
<div class='box'>1</div> |
This file contains hidden or 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
/** | |
* Definition for singly-linked list. | |
* class ListNode { | |
* val: number | |
* next: ListNode | null | |
* constructor(val?: number, next?: ListNode | null) { | |
* this.val = (val===undefined ? 0 : val) | |
* this.next = (next===undefined ? null : next) | |
* } | |
* } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
const maxProfit = prices => { | |
let left = 0; | |
let right = 1; | |
let maxProfit = 0; | |
while (right < prices.length) { | |
if (prices[left] < prices[right]) { | |
const profit = prices[right] - prices[left]; | |
maxProfit = Math.max(maxProfit, profit); | |
} |
NewerOlder