xxxxxxxxxx
// in details
https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04
xxxxxxxxxx
sudo apt update
sudo apt install apache2
sudo ufw app list
sudo ufw allow "Apache Full"
sudo apt install mysql-server
sudo mysql
CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'YOUTPASSWORD';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost';
flush privileges;
sudo apt install php libapache2-mod-php php-mysql php-curl php-zip php-gd php-mbstring php-xml
or
sudo apt install php7.4 libapache2-mod-php7.4 php7.4-mysql php7.4-curl php7.4-zip php7.4-gd php7.4-mbstring php7.4-xml
if error
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
xxxxxxxxxx
sudo apt install apache2 php libapache2-mod-php mariadb-server php-mysql
xxxxxxxxxx
sudo tasksel install lamp-server
xxxxxxxxxx
sudo apt install apache2 php libapache2-mod-php mysql-server php-mysql
xxxxxxxxxx
class Solution:
def reverseOddLevels(self, root: TreeNode | None) -> TreeNode | None:
def dfs(left: TreeNode | None, right: TreeNode | None, isOddLevel: bool) -> None:
if not left:
return
if isOddLevel:
left.val, right.val = right.val, left.val
dfs(left.left, right.right, not isOddLevel)
dfs(left.right, right.left, not isOddLevel)
dfs(root.left, root.right, True)
return root